package com.manager;

import java.sql.ResultSet;
import java.sql.SQLException;

import control.database.DataBase;

public class Register_kind {
	public String getRegister_type(String username){
    String type="1";
	String sql="select register_type from register_kind where register_code='"+username+"'";
	DataBase db=new DataBase();
	ResultSet rs = null;
	rs=db.executeQuery(sql);
	try {
		while(rs.next())
		{
		type=rs.getString("register_type");
		}
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	try {
		rs.close();
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	db.closeStmt();
	db.closeConn();
	return type;
	}
	public static void main(String[] args) {
	System.out.println("type="+new Register_kind().getRegister_type("04332967373"));
	

	}

}
